<!-- 查看员工 -->
<template>
	<view class="observe-content">
		<rf-navbar :title="'员工账号'" src="../../static/images/observe/topIdx.png" @click="onBack"></rf-navbar>

		<view class="observe-body" style="position: absolute; background-color: transparent;">
			<uni-table border stripe emptyText="暂无更多数据">
				<!-- 表头行 -->
				<uni-tr style="background-color: ghostwhite;">
					<uni-th align="center">员工</uni-th>
					<uni-th align="center">联系方式</uni-th>
					<uni-th align="center">账号</uni-th>
					<uni-th align="center">密码</uni-th>
				</uni-tr>
				<!-- 表格数据行 -->
				<uni-tr v-for="(item, idx) in list" style="background-color: white;">
					<uni-td align="center">{{item.nickname || "未知"}}</uni-td>
					<uni-td align="center">{{item.phone || "未知"}}</uni-td>
					<uni-td align="center">{{item.username || "未知"}}</uni-td>
					<uni-td align="center">{{item.password || "未知"}}</uni-td>
				</uni-tr>
			</uni-table>
		</view>
		<!-- 加载loading -->
		<rf-load :loading="loading" title="加载中..."></rf-load>
	</view>
</template>

<script>
	import {
		mapMutations,
		mapState,
	} from 'vuex'; //引入mapState
	import {
		worker_list
	} from '@/api/sgw.js'

	export default {
		data() {
			return {

				loading: false, // 加载中提示

				total_income: 0, // 累计广告收益
				total_user: 0, // 累计用户
				yesterday_income: 0, // 昨日广告值
				month_income: 0, // 当月广告值
				new_user: 0, // 新增用户
				income: 0, // 广告值

				list: [],
			};
		},
		created() {

		},
		computed: {
			...mapState(['userInfo', 'hasLogin']),
		},
		onLoad(options) {

			this._getData()
		},
		mounted() {

		},
		onUnload() {},
		onShow() {
			let _that = this;
			_that.params.pageNum = 1;
			// _that.getObserveList()
		},
		onHide() {},
		methods: {
			...mapMutations(["login", "updateState"]),
			onBack() {
				uni.navigateBack();
			},

			_getData() {
				// /index/worker_detail
				let _that = this
				this.loading = true
				worker_list("").then(res => {
					_that.loading = false
					_that.list = res.data
				}).catch(err => {
					_that.loading = false
				})
			},
		},

	};
</script>

<style lang="scss" scoped>
	page {
		background-color: #fff;
	}

	.observe-content {

		.observe-body {
			padding: 20px 10px;
			width: 100vw;
			min-height: 70vh;

			background-color: #FFF5F5F5;

		}
	}
</style>